Small savings
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 4 Apr 2006 04:14:17 +0000 (04:14 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 4 Apr 2006 04:14:17 +0000 (04:14 +0000)
ChangeLog
ChangeLog.pre-2-10
gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf.c
gdk/gdkrgb.c
gtk/gtkicontheme.c

index d524cd597fe73fbfebedd684679124b8ee41d205..c920238f91afbfd0ee6b33a264b2eae6e89650bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2006-04-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/gdkrgb.c: Get rid of a duplicate copy of the visual names.
+
        * gtk/gtkmain.c: Make gtk_args const.
 
        * gtk/gtkicontheme.c (pixbuf_supports_svg): Save one static.
index d524cd597fe73fbfebedd684679124b8ee41d205..c920238f91afbfd0ee6b33a264b2eae6e89650bd 100644 (file)
@@ -1,5 +1,7 @@
 2006-04-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/gdkrgb.c: Get rid of a duplicate copy of the visual names.
+
        * gtk/gtkmain.c: Make gtk_args const.
 
        * gtk/gtkicontheme.c (pixbuf_supports_svg): Save one static.
index aa97701fc52a2452dbbf7636a5851e4d035cbe97..9a4b09b9ad1d9a7e1854778417f43d0c7d5b1e42 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * gdk-pixbuf.c: No point in making the error path fast by 
+       caching quarks.
+
 2006-03-24  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Remove a
index 8847c734e58a392e987155a3ecb446f35807f5c9..1bebc9b61ae06ee0839efbebbaa449a6a547303a 100644 (file)
@@ -542,11 +542,7 @@ GDK_PIXBUF_VAR const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
 GQuark
 gdk_pixbuf_error_quark (void)
 {
-  static GQuark q = 0;
-  if (q == 0)
-    q = g_quark_from_static_string ("gdk-pixbuf-error-quark");
-
-  return q;
+  return g_quark_from_static_string ("gdk-pixbuf-error-quark");
 }
 
 /**
index a7aa8920baa08b0dcc936a9941728e251fd49e0a..d6e481f8504e0a0cfb7f978b3a564d74128c6433 100644 (file)
@@ -54,16 +54,6 @@ typedef void (*GdkRgbConvFunc) (GdkRgbInfo *image_info, GdkImage *image,
                                gint x_align, gint y_align,
                                GdkRgbCmap *cmap);
 
-static const gchar *const visual_names[] =
-{
-  "static gray",
-  "grayscale",
-  "static color",
-  "pseudo color",
-  "true color",
-  "direct color",
-};
-
 #define STAGE_ROWSTRIDE (GDK_SCRATCH_IMAGE_WIDTH * 3)
 
 /* Some of these fields should go, as they're not being used at all. (?)
@@ -445,8 +435,8 @@ gdk_rgb_score_visual (GdkVisual *visual)
   pseudo = (visual->type == GDK_VISUAL_PSEUDO_COLOR || visual->type == GDK_VISUAL_TRUE_COLOR);
 
   if (gdk_rgb_verbose)
-    g_print ("Visual type = %s, depth = %d, %x:%x:%x%s; score=%x\n",
-            visual_names[visual->type],
+    g_print ("Visual type = %d, depth = %d, %x:%x:%x%s; score=%x\n",
+            visual->type,
             visual->depth,
             visual->red_mask,
             visual->green_mask,
@@ -3066,8 +3056,8 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info)
 
   byte_order = image_info->visual->byte_order;
   if (gdk_rgb_verbose)
-    g_print ("Chose visual type=%s depth=%d, image bpp=%d, %s first\n",
-            visual_names[image_info->visual->type], image_info->visual->depth,
+    g_print ("Chose visual type=%d depth=%d, image bpp=%d, %s first\n",
+            image_info->visual->type, image_info->visual->depth,
             bpp, byte_order == GDK_LSB_FIRST ? "lsb" : "msb");
 
 #if G_BYTE_ORDER == G_BIG_ENDIAN
@@ -3235,10 +3225,10 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info)
 
   if (!conv)
     {
-      g_warning ("Visual type=%s depth=%d, image bpp=%d, %s first\n"
+      g_warning ("Visual type=%d depth=%d, image bpp=%d, %s first\n"
                 "is not supported by GdkRGB. Please submit a bug report\n"
                 "with the above values to bugzilla.gnome.org",
-                visual_names[vtype], depth, bpp,
+                vtype, depth, bpp,
                 byte_order == GDK_LSB_FIRST ? "lsb" : "msb");
       exit (1);
     }
index 19b83f6c6a1fe072dd8d9b8fa8d7b21d9c95677a..61fddcbe71bde79e8507c25ffe13217efc91dbae 100644 (file)
@@ -539,12 +539,12 @@ pixbuf_supports_svg (void)
 {
   GSList *formats = gdk_pixbuf_get_formats ();
   GSList *tmp_list;
-  static gboolean found_svg = FALSE;
-  static gboolean value_known = FALSE;
+  static gint found_svg = -1;
 
-  if (value_known)
+  if (found_svg != -1)
     return found_svg;
-  
+  found_svg = FALSE; 
   for (tmp_list = formats; tmp_list && !found_svg; tmp_list = tmp_list->next)
     {
       gchar **mime_types = gdk_pixbuf_format_get_mime_types (tmp_list->data);
@@ -560,7 +560,6 @@ pixbuf_supports_svg (void)
     }
 
   g_slist_free (formats);
-  value_known = TRUE;
   
   return found_svg;
 }